package com.wyy.testtranaction.controller;

import com.wyy.testtranaction.DebugProperty;
import com.wyy.testtranaction.service.UserService1;
import com.wyy.testtranaction.service.UserService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Date: 2021/9/2
 * @Author: wyy
 */
@RestController
public class ApiController {
    @Autowired
    private UserService1 userService1;

    @Autowired
    private UserService2 userService2;

    @Autowired
    private DebugProperty debugProperty;

//    @Value("${a.b}")
    private Map<String,Boolean> map;

    /**
     * curl -v 'localhost:8081/test'
     * @throws Exception
     */
    @GetMapping("test")
    public void test() throws Exception {
//        userService1.insertNoTransaction();
//        userService2.insertNoTransaction();
        userService1.testRollback();
    }
}
